home *** CD-ROM | disk | FTP | other *** search
- /**** This file contains auxiliary (not directly related) functions and declarations for the Boyer-Moore and Dynamic listings */
-
- /* exit.c : error handling and deallocation functions for dynamic */
-
- #include "dec.h"
- #include "errors.h"
-
- /* error_message : prints message to stderr before exiting */
- void error_message(error)
- ERROR_CODE error;
- {
- if (error)
- fprintf(stderr, "Error %d: ", error);
- switch (error) {
- case NO_ERROR:
- break;
- default:
- fprintf(stderr, UNKNOWN);
- break;
- }
- }
-
- /* exit_cleanly : deallocate all allocated memory and quit */
- void exit_cleanly(error, exit_code)
- ERROR_CODE error;
- int exit_code;
- {
- if (error) /* print error message, if any */
- error_message(error);
- exit(exit_code); /* quit */
- }
-
-